<?php include BASE_PATH.'install/step/header.tpl.php';?>
	<div class="container" style="margin-bottom: 180px;">
		<div id="bar" class="progress progress-striped active" style="margin-top: 100px;">
			<div class="bar" style="width: 75%;"></div>
		</div>
		<div class="well fade in">
			<div class="tabbable tabs-left">
			  <ul class="nav nav-tabs">
				<?php for($i=1; $i<=count($steps); $i++){ ?>
					<li <?php if($step==$i) { ?> class="active" <?php } ?> ><a data-toggle="tab"><?php echo $steps[$i]; ?></a></li>
                <?php } ?>
              </ul>
			  <div class="tab-content">
				<form id="install" action="install.php" method="post" class="form-horizontal">
					<fieldset class="border">
						<legend class="border">数据库信息</legend>
						<div class="control-group">
							<label class="control-label" for="dbhost">数据库主机：</label>
							<div class="controls">
							  <input type="text" id="dbhost" name="dbhost" placeholder="数据库主机">
							</div>
						 </div>
						 <div class="control-group">
							<label class="control-label" for="">数据库帐号：</label>
							<div class="controls">
							  <input type="text" id="dbuser" name="dbuser" placeholder="数据库帐号">
							</div>
						 </div>
						 <div class="control-group">
							<label class="control-label" for="">数据库密码：</label>
							<div class="controls">
							  <input type="password" id="dbpw" name="dbpw" placeholder="数据库密码">
							</div>
						 </div>
						 <div class="control-group">
							<label class="control-label" for="">数据库名称：</label>
							<div class="controls">
							  <input type="text" id="dbname" name="dbname" placeholder="数据库名称">
							</div>
						 </div>
						 <div class="control-group">
							<label class="control-label" for="">数据表前缀：</label>
							<div class="controls">
							  <input type="text" id="tablepre" name="tablepre" placeholder="数据表前缀">
							</div>
						 </div>
						 <div class="control-group">
							<label class="control-label" for="">数据库字符集：</label>
							<div class="controls">
							  <label class="radio inline">
								<input type="radio" name="dbcharset" value>
								  默认
							  </label>
							  <label class="radio inline">
								<input type="radio" name="dbcharset" value="gbk">
								  GBK
							  </label>
							  <label class="radio inline">
                                <input type="radio" name="dbcharset" value="utf8" checked>
								  utf8
                              </label>
							  <label class="radio inline">
                                <input type="radio" name="dbcharset" value="latin1">
								  latin1
                              </label>
							</div>
						 </div>
					</fieldset>
					<fieldset class="border">
						<legend class="border">账号信息</legend>
						<div class="control-group">
							<label class="control-label" for="">超级管理员帐号：</label>
							<div class="controls">
							  <input type="text" id="username" name="username" placeholder="超级管理员帐号">
							</div>
						 </div>
						 <div class="control-group">
							<label class="control-label" for="">管理员密码：</label>
							<div class="controls">
							  <input type="password" id="password" name="password" placeholder="管理员密码">
							</div>
						 </div>
						 <div class="control-group">
							<label class="control-label" for="">确认密码：</label>
							<div class="controls">
							  <input type="password" id="pwdconfirm" name="pwdconfirm" placeholder="确认密码">
							</div>
						 </div>
						 <div class="control-group">
							<label class="control-label" for="">管理员E-mail：</label>
							<div class="controls">
							  <input type="text" id="email" name="email" placeholder="管理员E-mail">
							</div>
						 </div>
					</fieldset>
				</form>
			  </div>
			</div>
		</div>
		<div class="row-fluid">
			<div class="span2">
				<a class="btn btn-large btn-block btn-info" href="javascript:history.go(-1);">上一步</a>
			</div>
			<div class="span2 offset8">
				<a class="btn btn-large btn-block btn-info" href="javascript:void(0);" onclick="install_check();return false;">下一步</a>
			</div>
		</div>
	</div>
	<script src="../static/js/jquery.js"></script>
	<script type="text/javascript">
		function install_check(){
			var hasEmpty = false;
			$('input[type=text]').each(function(){
				var input = $(this);
				if(input.val()==''){
					input.after('<span class="help-inline"><ul role="alert"><li>不能为空</li></ul></span>');
					hasEmpty = true;
					return false;
				}
			});
			if(!hasEmpty){
				$('#install').submit();
			}
		}
		$(document).ready(function(){
			$('input[type=text]').focus(function(){
				$(this).siblings().remove();
			});
		});
	</script>
</body>
</html>